IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[State]') AND type in (N'U'))
DROP TABLE [dbo].[State]
GO

CREATE TABLE [dbo].[State](
	[StateID] [int] NOT NULL IDENTITY(1,1),
	[StateName] [varchar](50) NULL,
 CONSTRAINT [PK_State] PRIMARY KEY CLUSTERED 
(
	[StateID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[District]') AND type in (N'U'))
DROP TABLE [dbo].[District]
GO

CREATE TABLE [dbo].[District](
	[DistrictID] [int] NOT NULL IDENTITY(1,1),
	[StateID] [int] NULL,
	[DistrictName] [varchar](100) NULL,
 CONSTRAINT [PK_District] PRIMARY KEY CLUSTERED 
(
	[DistrictID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PropertyDesc]') AND type in (N'U'))
DROP TABLE [dbo].[PropertyDesc]
GO

CREATE TABLE [dbo].[PropertyDesc](
	[ID] [uniqueidentifier] NOT NULL,
	[DistrictID] [int] NULL,
	[Location] [varchar](50) NULL,
	[Address] [varchar](500) NULL,
	[PropertyDescription] [varchar](1000) NULL,
	[Name] [varchar](100) NULL,
	[EmailID] [varchar](100) NULL,
	[ContactNo] [varchar](50) NULL,
	[PreferredTime] [varchar](200) NULL,
	[PropertyType] [int] NULL,
	[PurposeType] [int] NULL,
	[Price] [int] NULL,
	[Inactive] [bit] NULL,
	[ModifiedOn] [Datetime] NULL,
	[UserID] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_PropertyDesc] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[UserInfo]') AND type in (N'U'))
DROP TABLE [dbo].[UserInfo]
GO

CREATE TABLE [dbo].[UserInfo](
	[ID] [uniqueidentifier] NOT NULL,
	[EmailID] [varchar](100) NULL,
	[Password] [varchar](100) NULL,
	[Name] [varchar](100) NULL,
	[ContactNo] [varchar](50) NULL,
	[Inactive] [bit] NULL,
	[ModifiedOn] [Datetime] NULL,
 CONSTRAINT [PK_UserInfo] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Location]') AND type in (N'U'))
DROP TABLE [dbo].[Location]
GO

CREATE TABLE [dbo].[Location](
	[ID] [int] NOT NULL IDENTITY(1,1),
	[DistrictID] [int] NOT NULL ,
	[Name] [varchar](100) NULL
 CONSTRAINT [PK_Location] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO




